class Solution(object):
    def repeatedNTimes(self, nums):
        """
        :type nums: List[int]
        :rtype: int
        """
        now = {nums[0], nums[1]}
        if len(now) == 1:
            return nums[0]
        for i in range(1, len(nums) // 2):
            next_set = {nums[2 * i], nums[2 * i + 1]}
            if len(next_set) == 1:
                return nums[2 * i]
            if now & next_set:
                return (now & next_set).pop()
            now = next_set


